<?php
	if(!isset($rootdir)) $rootdir = "/home/nrb62281/public_html";
	if(!isset($baseURL)) $baseURL = "http://forums.worldofwarcraft.com/images/portraits/";
	
	$genderArray[1] = "female"; $genderArray[0] = "male";
	
	$raceArray[1] = "Human"; $raceArray[2] = "Orc"; $raceArray[3] = "Dwarf"; $raceArray[4] = "Night Elf"; $raceArray[5] = "Undead"; 
	$raceArray[6] = "Tauren"; $raceArray[7] = "Gnome"; $raceArray[8] = "Troll"; $raceArray[10] = "Blood Elf"; $raceArray[11] = "Draenei"; 
//	$raceArray[9] = "Goblin"; $raceArray[22] = "Worgen"; 

	$classArray[1] = "Warrior"; $classArray[2] = "Paladin"; $classArray[3] = "Hunter"; $classArray[4] = "Rogue"; $classArray[5] = "Priest"; 
	$classArray[6] = "Death Knight"; $classArray[7] = "Shaman"; $classArray[8] = "Mage"; $classArray[9] = "Warlock"; $classArray[11] = "Druid"; 
//	$classArray[10] = "???"; 

	$levelArray["wow-default/"] = "1"; $levelArray["wow/"] = "60"; $levelArray["wow-70/"] = "70"; $levelArray["wow-80/"] = "80";
	
	$output = "";
	foreach($genderArray as $genderIndex => $genderLabel){
		foreach($raceArray as $raceIndex => $raceLabel){
			foreach($classArray as $classIndex => $classLabel){
				foreach($levelArray as $levelIndex => $levelLabel){
				
					//if(file_exists($baseURL . $levelIndex . $genderIndex . '-' . $raceIndex . '-' . $classIndex . '.gif')){
						$copyresult = copy($baseURL . $levelIndex . $genderIndex . '-' . $raceIndex . '-' . $classIndex . '.gif',
							$rootdir . "/wowsig/_images/portraits/" . $raceLabel . "/" . $classLabel . "/" . $genderLabel . "/" . $levelLabel . ".gif");
						if(!$copyresult){
							$output .= "FAILURE: ".$baseURL . $levelIndex . $genderIndex . '-' . $raceIndex . '-' . $classIndex . '.gif TO ' . $rootdir . "/wowsig/_images/portraits/" . $raceLabel . "/" . $classLabel . "/" . $genderLabel . "/" . $levelLabel . ".gif" . "\n<br/>";
						}else{
							$output .= "SUCCESS: ".$baseURL . $levelIndex . $genderIndex . '-' . $raceIndex . '-' . $classIndex . '.gif TO ' . $rootdir . "/wowsig/_images/portraits/" . $raceLabel . "/" . $classLabel . "/" . $genderLabel . "/" . $levelLabel . ".gif" . "\n<br/>";
						}
					//}
				}
			}
		}
	}
	echo $output;
/*
base URL:
http://forums.worldofwarcraft.com/images/portraits/FOLDERFORLEVEL/image

folder:
wow-default/
wow/
wow-70/
wow-80/

image:
gender-race-class.gif

gender 1 = female
gender 0 = male

http://forums.worldofwarcraft.com/images/pixel.gif

race 1 = human
raec 2 = orc
race 3 = dwarf
race 4 = night elf
race 5 = undead
race 6 = tauren
race 7 = gnome
race 8 = troll
race 10 = blood elf
race 11 = draenei
?race 9 = goblin ?
?race 22 = worgen ?

class 1 = warrior
class 2 = paladin
class 3 = hunter
class 4 = rogue
class 5 = priest
class 6 = death knight
class 7 = shaman
class 8 = mage
class 9 = warlock
?class 10 = ?
class 11 = druid

http://forums.worldofwarcraft.com/images/portraits/wow-default/1-4-11.gif
female nelf druid
http://forums.worldofwarcraft.com/images/portraits/wow-default/1-4-11.gif
*/
?>